1. Field of the Invention
The present invention relates to an image processing apparatus and its control method to correct image data in correspondence with the feature of the image data.
2. Description of the Related Art
In recent years, a digital camera which records a captured still image obtained with an image sensor as digital data is widely used. Further, in accordance with broad use of a large capacity memory card to record images, storage of a large number of photographed images is a general application. Since a large number of images can be obtained and stored easily, an increasing number of images are photographed and stored without careful consideration and with inappropriate exposure value. For example, in an image photographed in underexposure status, the entire stored image is dark although photographing has been made for a bright spot. Upon the display of such an image obtained in underexposure status on a computer screen, or upon print-output of such image for inspection, it is desirable to perform the appropriate correction processing to compensate over/underexposure upon photographing on the photographed image. As it is very troublesome to manually perform the correction processing on a large number of images separately, it is desirable to automatically determine over/underexposure status of each photographed image and perform correction processing. However, it is difficult to automatically determine, for example, a nightscape image, which is entirely dark, and an underexposure image. To solve this problem, a method for automatically determining a nightscape image and an underexposure image and performing appropriate correction processing is proposed.
Literature 1 (Japanese Patent Laid-Open No. 2007-228221) discloses a method for determining a photographed scene and re-correcting correction processing conditions, set based on the scene determination, in correspondence with nightscape index. The night view index in this Literature 1 is calculated by using photographing conditions upon photographing, skin color pixel information of the image, and average luminance of the entire image. In the method disclosed in the Literature 1, the correction condition is automatically set by determining the image photographing scene of the photographed image. Further, by addition of correction in consideration of night view photographing, a more appropriately-corrected image can be obtained. However, upon determination of photographing scene, if the photographing conditions upon photographing are not set or set conditions have been replaced with other conditions, the scene determination is insufficient.
Further, Literature 2 (Japanese Patent No. 04057147) discloses a backlight scene determination method for determination of a backlight scene without erroneous determination even when a dark area other than a main subject exists. In the method disclosed in the Literature 2, it is not determined whether or not the image is a landscape image in an underexposure status where the brightness is low or a nightscape image. For example, if the background is dark and a part of the image is irradiated with bright light in a nightscape image, the irradiated part is determined as a non-backlighted subject. Further, if the brightness and saturation distribution are low in a dark area, the image is determined as a backlighted image and the dark area in the nightscape image is determined as a backlighted part. In this determination of the dark area of nightscape as a backlighted part, the dark area of the nightscape image is corrected to a brighter area.
Further, Literature 3 (Japanese Patent Laid-Open No. 2006-324987) discloses a method of dividing a photographed image into plural sections, calculating section feature quantities as quantities of divided image sections, calculating the accuracy of photographic scene assigned to the photographed image from the section feature quantity, and determining the degree of correction with respect to the photographed image from the calculated accuracy of the photographic scene. In the Literature 3, as a method for calculating the accuracy of photographic scene, a luminance difference between a section group positioned in the central area of the photographed image and a section group positioned in a peripheral area is used in for example determination of backlighted and frontlighted image. That is, if the luminance of the section group in the central area is lower than that of the section group in the peripheral area, the scene is determined as a backlighted scene. On the other hand, if the luminance of the section group in the central area is higher than that of the section group in the peripheral area, the scene is determined as a frontlighted scene. At this time, the accuracy of backlighted/frontlighted scene is calculated based on the above-described luminance difference, in consideration of spot light as a photographic scene which is regarded as extreme front light scene. However, in the Literature 3, as the scene accuracy is determined with reference to only the feature quantity analyzed from the image, the scene accuracies of various images cannot be obtained. For example, upon photographing of nightscape, if a central area is dark as a nightscape while a peripheral portion is neon-lighted and bright, the luminance of the central area is higher than that of the peripheral area and the scene is determined as a backlighted scene. Further, in a nightscape image and a backlighted image, if the difference between the luminance of the central area and that of the peripheral area in each image is the same, the same scene accuracy is calculated, and the discrimination between nightscape image and backlighted image cannot be made.